<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<title>项目管理系统 </title>
<link rel="stylesheet" rev="stylesheet" href="jsp/skin/css/style.css" type="text/css" media="all" />
<script language="javascript" src="js/jquery-1.8.2.js"></script>


<script language="JavaScript" type="text/javascript">
function uptAdvertAddressAct(){
  alert(1);
  var idCheck = document.getElementById(id);
  if(document.getElementById(id).value!=""){
     var value  = $("#myFile").val();
     $("#hiddenDefPath").val(value);
  }
  document.register.action="tblAdvertAddressAct!uptAdvertAddress.action";
  document.register.submit();
}
function userRegister(){
   alert("123");
   var value=document.getElementById("myFile").value;
   alert(value);
   document.register.action="tblAdvertAddressAct.action?";
   document.register.submit();
   }
   
 function pageInit(){
      <%
        Object obj = request.getAttribute("message");
      %>
      var message = '<%=obj%>';
     if(message!='null'){
       alert(message);
     }
   }
   
   function checkAll(){
       return isNull("userName")*isNull("passWord");
   }
   
   function passwordCon(){
      if(isNull("passWord")*isNull("passWordCon")==0)
      {
         alert("密码或确认密码至少有一项为空！");
         return 0;
      }else{
         if(document.getElementById("passWord").value!=document.getElementById("passWordCon").value){
             alert("密码和确认密码必须相同！");
             return 0;
          }else{
             return 1;
          }
      }
   }
   
   
//为空检验
function isNull(id){
   var idValue = document.getElementById(id).value;
     if(idValue==""){
     alert(id+"项不能为空！");
     return 0;
  }else{
    return 1;
  }
}
</script>
<style type="text/css">
<!--
.atten {font-size:12px;font-weight:normal;color:#F00;}
-->
</style>
</head>

<body class="ContentBody" onload="pageInit();">
  <s:form action="" method="post" name="register" id="register" enctype ="multipart/form-data">
   <s:hidden name="tblAdvertAddressVo.id" value="%{tblAdvertAddressVo.id}"></s:hidden>
   <s:hidden name="tblAdvertAddressVo.defPath" id="hiddenDefPath" value="%{tblAdvertAddressVo.defPath}"></s:hidden>
<div class="MainDiv">
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  <tr>
      <th class="tablestyle_title" >广告位注册页面</th>
  </tr>
  <tr>
    <td class="CPanel">
		
		<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
		<tr><td align="left">
		<input type="button" name="Submit" value="保存" class="button" onclick="alert('保存成功！');"/>　
			
			<input type="button" name="Submit2" value="返回" class="button" onclick="window.history.go(-1);"/>
		</td></tr>

		<tr>
			<td width="100%">
				<fieldset style="height:100%;">
				<legend>广告位注册</legend>
					  <table border="0" cellpadding="2" cellspacing="1" style="width:100%">
					 
					  <tr>
					    <td align="right" width="13%">广告名字:</td>
					    <td width="41%">
					    <s:textfield name="tblAdvertAddressVo.advertName" theme="simple"></s:textfield>
				        <span class="red"> *</span></td>
					  </tr>
					  <tr>
					    <td align="right" width="13%">广告宽度:</td>
					    <td width="41%">
					    <s:textfield name="tblAdvertAddressVo.width" theme="simple"></s:textfield>
				        <span class="red"> *</span></td>
					  </tr>
					  <tr>
					    <td align="right" width="13%">广告高度:</td>
					    <td width="41%">
					    <s:textfield name="tblAdvertAddressVo.height" theme="simple"></s:textfield>
				        <span class="red"> *</span></td>
					  </tr>
					  <tr>
					    <td align="right" width="13%">摘要:</td>
					    <td width="41%">
					    <s:textarea name="tblAdvertAddressVo.notes" rows="5" cols="22" theme="simple"></s:textarea>
				        </td>
					  </tr>
					  <tr>
					    <td align="right" width="13%">广告类型:</td>
					    <td width="41%">
					    <s:action name="codeAct!findDefCode" id="defCode"></s:action>
                        <s:select theme="simple" name="tblAdvertAddressVo.defType" 
                          listKey="code" listValue="value" list="#defCode.tbldeftypeList"/>
				        <span class="red"> *</span></td>
					  </tr>
					  <tr>
					    <td align="right" width="13%">默认路径:</td>
					    <td width="41%">
					    <s:file name="myFile" id="myFile" theme="simple"></s:file>
				        <span class="red"> *</span></td>
					  </tr>
					   
					  </table>
			 <br />
				</fieldset>			</td></tr>
		
		
		</table>
	
	
	 </td>
  </tr>
  

		
		
		
		
		<tr>
			<td colspan="2" align="center" height="50px" >
			<s:set name="buttonFlagValue" value="%{buttonFlagValue}" />
			  <s:if test="#buttonFlagValue!='upt'">
			    <input type="button" name="Button" value="注册" class="button" onclick="userRegister();"/>
			  </s:if>
			  <s:else><input type="button" name="Button" value="更新" class="button" onclick="uptAdvertAddressAct();"/></s:else>
			</td>
		</tr>
		</table>
	

  
  
  
  


</div>
</s:form>
</body>
</html>

